<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>购物车</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta content="zh-cn" http-equiv="content-language" />
<meta content="" name="copyright" />
<%@ include file="/page/pc/include.jsp"%>
<!--[if lte IE 6]> 
<script type="text/javascript" src="js/PNG.js"></script> 
<script> 
PNG.fix('*'); 
</script> 
<![endif]-->
<style>
	.myloginbox{position:fixed;width:356px;height:346px;left:50%;top:40%;margin-left:-178px;margin-top:-173px;}
	.myloginbox .hd{height:33px;background:#f3f3f3;line-height:33px;position:relative;}
	.myloginbox .hd h3{font-weight:400;padding-left:10px;font-size:14px;color:#666}
	.myloginbox .hd span{position:absolute;right:0;top:0;}
	.myloginbox  .hd span a{display:block;width:32px;height:33px;background:url(<%=basePath%>/statics/images/icon_close.png) no-repeat center center;}
</style>
</head>
<body style="background:#fff">
	<div class="popbox" id="myloginbox" style="display:none;">
		<div class="myloginbox">
			<div class="hd">
	        	<h3>未登录</h3>
	            <span>
	            	<a href="javascript:void(0)"></a>
	            </span>
	        </div>
	    	<div class="login_box">
	                	<div class="login_nav">
	                    	<ul>
	                        	<li class="current">
	                            	<a href="javascript:void(0)">账号登录</a><s></s>
	                            </li>
	                            <li class="">
	                            	<a href="javascript:void(0)">手机登录</a>
	                            </li>
	                        </ul>
	                    </div>
	                    <div class="login_part11" style="display: block;">
	                    <div class="login_info1">
	                    	<dl>
	                        	<dt>
	                            	<strong><i class="icon1"></i></strong>
	                                <div class="txt1">
	                                	<b><input id="userCode" type="text" class="inputstyle1" value="" placeholder="用户名"></b><a id="btn_clear_user_name" href="javascript:void(0)" class="icon_close1"></a> 
	                                </div>
	                            </dt>
	                            <dt>
	                            	<strong><i class="icon2"></i></strong>
	                                <div class="txt1">
	                                	<b><input id="password" type="password" class="inputstyle1" placeholder="密码"></b>
	                                </div>
	                            </dt>
	                            <div class="forget_part">
	                            	<div id="errorDiv" style="float: left;word-wrap: break-word;width:240px;padding-top:0px;color:red;"></div>
	                            	<p><a href="<%=basePath%>/home/toFindPwdPage">忘记密码</a></p>
	                            </div>
	                            <dd>
	                            	<input id="btn_login" type="button" class="inputbtn1" value="登  录">
	                            </dd>
	                            <div class="hasnotlogin">
	                            	<p>还没账号？ <a href="<%=basePath %>/reg/toRegPage">立即注册</a></p>
	                            </div>
	                        </dl>
	                    </div>
	                    </div>
	                    <div class="login_part11" style="display: none;">
	                    	<div class="ewm_part">
	                        	<p><img src="${rootPath}/statics/images/ewm_pic.jpg"></p>
	                        </div>
	                    	<div class="hasnotlogin">
	                            	<p>还没账号？ <a href="<%=basePath %>/reg/toRegPage">立即注册</a></p>
	                            </div>
	                    </div>
	                </div>
	    </div>
	</div>
	
	
	
	<div class="wrap">
		<!---头部公共部分开始-->
		<div class="header">
			<jsp:include page="../header_top.jsp" />
			
			<div class="index_header2">
				<div class="index_header2_con">
					<h1>
						<a href="${rootPath}/pc/index"><img src="${rootPath}/statics/images/logo.png" /></a><em>购物车</em>
					</h1>
					<div class="right">
						<div class="search_part">
							<form action="${rootPath}/pc/product/search">
								<div class="search_part1">
									<div class="input_txt">
										<input type="text" class="inputstyle" placeholder="" />
									</div>
									<input type="submit" class="inputbtn" value="搜 索" />
								</div>
							</form>
						</div>
					</div>
				</div>
			</div>

		</div>
		<div class="site_wrap14">
			<div class="site_wrap14_con">
				<c:if test="${shoppingcart.size() == 0 }">
					<div class="cart_none" style="padding:30px;">
						<p>
							<img src="${rootPath}/statics/images/cart_none.png" />购物车空了哦！！！，快去看看心仪的商品吧~
						</p>
					</div>
				</c:if>
				<c:if test="${shoppingcart.size() != 0 }">
				<div class="cart_part">
					<div class="hd">
						<h3>
							全部商品<!--  <span id="total_shopping_cart_num"></span> -->
						</h3>
					</div>
					<div class="bd">
						<div class="cart_list">

							<table>
								<thead>
									<tr>
										<td style="width: 130px; padding-left: 12px; text-align: left"><label>
											<input name="btn_select_all_top" checked="checked" type="checkbox" />全选</label>
										</td>
										<td style="width: 545px; text-align: left">商品</td>
										<td style="width: 74px; text-align: right">单价</td>
										<td style="width: 104px">数量</td>
										<td style="width: 80px; text-align: right">小计</td>
										<td style="width: 90px; text-align: left">操作</td>
									</tr>
								</thead>
								<tbody>
								
									<c:forEach items="${shoppingcart}" var="product">
									<tr name="shopping_cart_item">
										<td colspan="2">
											<input name="cart_chk" type="checkbox" checked="checked" id="${product.id}" productId="${product.productId}" style="float: left; margin-right: 12px" />
											<input type="hidden"  id="item_id"  value ="${product.id}"/>
											<input type="hidden"  id="item_product_id"  value ="${product.productId}"/>
											<input type="hidden"  id="item_product_pric" value ="${product.productPrice}" />
											<div class="mycartpic">
												<div class="pic">
													<a href="${rootPath}/pc/product/detail?productId=${product.productId}"><img src="${imgRootURL}${product.imagePath}"/></a>
												</div>
												<div class="item-info">
													<h2><a href="${rootPath}/pc/product/detail?productId=${product.productId}">${product.productName}</a></h2>
												</div>
												
												<c:forEach items="${product.specList}" var="spec">
													<div class="item-info">
														<h2>${spec.specName}:${spec.specValue}</h2>
													</div>
												</c:forEach>
												
											</div>
										</td>
										<td style="text-align: right" ><span>￥</span><span id="item_product_price"><fmt:formatNumber type="number" value="${product.productPrice}" pattern="0.00" /></span></td>
										<td><div class="num_box2">
												<a id="btn_edit_buy_num" flag="reduce" href="javascript:void(0);" class="icon_jian1 disabled">-</a>
												<span><input id="item_buy_num" type="text" class="inputstyle1" value="${product.buyNum}" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')" /></span>
												<a id="btn_edit_buy_num" flag="add" href="javascript:void(0);" class="icon_jia1">+</a>
											</div></td>
										<td style="text-align: right" ><b id="item_total_product_price">￥<fmt:formatNumber type="number" value="${product.subTotalProductPrice}" pattern="0.00" /></b></td>
										<td><a id="btn_del_cart_item" productId="${product.productId}" href="javascript:void(0);" class="delbtn">删除</a>
											<a id="btn_add_to_favorite" productId="${product.productId}" href="javascript:void(0);" class="favbtn">加入收藏夹</a>
										</td>
									</tr>
									</c:forEach>
								</tbody>
							</table>
						</div>
						<div class="total_part">
							<div class="left">
								<label><input name="btn_select_all_bottom" type="checkbox" checked="checked" />全选</label>
								<button id="btn_batch_del_cart_item" class="inputbtn1">删除选中的商品</button>
								<button id="btn_batch_add_to_favorite" class="inputbtn2">加入收藏夹</button>
							</div>
							<div class="right">
								<div class="cart_info4">
									<em>已选择<i id="selected_num"></i>件商品
									</em> <b>总价：<i id="shopping_cart_money">￥<fmt:formatNumber type="number" value="${totalPrice }" pattern="0.00" /></i></b>
								</div>
								<strong> <a id="btn_shoppingcart_settle" href="javascript:void(0);">结算</a>
								</strong>
							</div>
						</div>
					</div>

				</div>
				</c:if>
				<div class="hot_part">
					<div class="hot_nav">
						<ul>
							<li class="current"><a href="javascript:void(0)">热品采购<i></i></a></li>
							<li><a href="javascript:void(0)">我的收藏<i></i></a></li>
							<li><a href="javascript:void(0)">最近浏览<i></i></a></li>
						</ul>
					</div>
					<div class="bd">
						<!-- 热品采购 -->
						<div class="hot_list">
							<ul>
								<c:forEach items="${topProductList }" var="product">
									<li>
										<div class="box14">
											<div class="pic">
												<a href="${rootPath}/pc/product/detail?productId=${product.id}"> <img src="${imgRootURL}${product.mainImagePath}" />
												</a>
											</div>
											<div class="item-info">
												<h2>
													<a href="${rootPath}/pc/product/detail?productId=${product.id}">${product.productName}</a>
												</h2>
												<h3>¥<fmt:formatNumber type="number" value="${product.productPrice}" pattern="0.00" /></h3>
												<p>
													<a href="${rootPath}/pc/product/detail?productId=${product.id}"  >加入购物车</a>
												</p>
											</div>
										</div>
									</li>
								</c:forEach>
							</ul>
						</div>
						<!-- 我的收藏 -->
						<div class="hot_list">
							<ul>
								<c:forEach items="${favoriteList }" var="product">
									<li>
										<div class="box14">
											<div class="pic">
												<a href="${rootPath}/pc/product/detail?productId=${product.id}">
													<img src="${imgRootURL}${product.mainImagePath}" />
												</a>
											</div>
											<div class="item-info">
												<h2>
													<a href="${rootPath}/pc/product/detail?productId=${product.id}">${product.productName}</a>
												</h2>
												<h3>¥<fmt:formatNumber type="number" value="${product.productPrice}" pattern="0.00" /></h3>
												<p>
													<a href="${rootPath}/pc/product/detail?productId=${product.id}"  >加入购物车</a>
												</p>
											</div>
										</div>
									</li>
								</c:forEach>
							</ul>
						</div>
						<!-- 最近浏览 -->
						<div class="hot_list">
							<ul>
								<c:forEach items="${recordList }" var="product">
									<li>
										<div class="box14">
											<div class="pic">
												<a href="${rootPath}/pc/product/detail?productId=${product.id}"> <img src="${imgRootURL}${product.mainImagePath}" />
												</a>
											</div>
											<div class="item-info">
												<h2>
													<a href="${rootPath}/pc/product/detail?productId=${product.id}">${product.productName}</a>
												</h2>
												<h3>¥<fmt:formatNumber type="number" value="${product.productPrice}" pattern="0.00" /></h3>
												<p>
													<a href="${rootPath}/pc/product/detail?productId=${product.id}"  >加入购物车</a>
												</p>
											</div>
										</div>
									</li>
								</c:forEach>
						</div>
					</div>
				</div>
			</div>
		</div>
		<!---网站底部开始-->
		<jsp:include page="../footer.jsp?showQaFlag=0"/>
		<!---网站底部结束-->
	</div>

	<div class="popbox" id="del_box" style="display: none">
		<div class="del_box">
			<div class="hd">
				<h3>删除</h3>
				<span><a id="btn_close" href="javascript:void(0);"></a></span>
			</div>
			<div class="bd">
				<div class="del_info">
					<strong> <img src="${rootPath}/statics/images/icon_tip2.png" />
					</strong>
					<div class="del_info_con">
						<h2 id="del_confirm_msg">是否删除商品？</h2>
						<h3>您可以选择加入收藏夹方便下次查看</h3>
						<p>
							<input type="hidden" id="del_type" value="1"/>
							<input id="btn_confirm_delete" type="button" class="inputbtn1" value="删除" />
							<input id="btn_confirm_add_to_favorite" productId="" type="button" class="inputbtn2" value="加入收藏夹" />
						</p>
					</div>
				</div>
			</div>
		</div>
	</div>
	
	

	<script charset="utf-8" language="javascript" type="text/javascript" src="<%=basePath%>/statics/js/nav.js"></script>
	<script type="text/javascript" src="<%=basePath%>/statics/plugins/layer/layer.js"></script>
	<script type="text/javascript" src="<%=basePath%>/statics/js/custom.js"></script>
	<script>
 	$(function(){
		jQuery('.hot_nav ul li').click(function() { TabSelect(".hot_nav ul li", "div.hot_list", "current", jQuery(this)) });
		jQuery('.hot_nav ul li').eq(0).trigger("click");
		
		// 登录窗口
		jQuery('.login_nav ul li').click(function() {
			TabSelect(".login_nav ul li", "div.login_part11", "current", jQuery(this)) 
		});
		
		jQuery('.login_nav ul li').eq(0).trigger("mouseover");
		$('#myloginbox .hd span a').click(function(){
			$('#myloginbox').toggle();
		});
		
		// 编辑购物车数量
		var item_buy_num = null;
		$("a[id='btn_edit_buy_num']").each(function(){
			$(this).click(function(){
				var flag = $(this).attr("flag");
				var tr = $(this).closest("tr");
				var id = tr.find("input[id='item_id']").val();
				var productId = tr.find("input[id='item_product_id']").val();
				item_buy_num = tr.find("input[id='item_buy_num']");
				var buyNum = null;
				if('add' == flag){
					buyNum = parseInt(item_buy_num.val()) + 1;
				}else if('reduce' == flag){
					if(parseInt(item_buy_num.val()) > 1){
						buyNum = parseInt(item_buy_num.val()) - 1;
					}else{
						item_buy_num.val("1");
						buyNum = 1;
						return false;
					}
				}
				item_buy_num.val(buyNum);
				editBuyNum(id, productId, buyNum);
			});
		});
		
		$("input[id='item_buy_num']").each(function(){
			$(this).blur(function(){
				var flag = $(this).attr("flag");
				var tr = $(this).closest("tr");
				var id = tr.find("input[id='item_id']").val();
				var productId = tr.find("input[id='item_product_id']").val();
				var buyNum = tr.find("input[id='item_buy_num']").val();
				if(buyNum && parseInt(buyNum) <= 1){
					tr.find("input[id='item_buy_num']").val("1");
					buyNum = 1;
				}
				editBuyNum(id, productId, buyNum);
			});
		});
		
		
		function editBuyNum(id, productId, buyNum){
			var url = rootPath + "/pc/shoppingcart/editBuyNum";
			var params = {
				id : id,
				productId : productId,
				buyNum : buyNum
			};
			$.ajax({
				type : "post",
				url : url,
				data : params,
				datatype : "json",
				success : function(json) {
					if (json.resultCode != '1') {
						//layer.msg('商品添加到购物车');
						layer.msg('修改购物车失败',{time:1000});
					}else{
						// 计算页面购物车金额
						// var total_shopping_cart_money = 0.0;
						$("tr[name='shopping_cart_item']").each(function(){ 
							var product_price = parseFloat($(this).find("#item_product_price").text());
							var buyNum = parseFloat($(this).find("#item_buy_num").val()); 
							var total_product_price = product_price * buyNum;
							$(this).find("#item_total_product_price").text("￥"+numberRand2(total_product_price));
							//total_shopping_cart_money = total_shopping_cart_money + total_product_price;
							//$("#shopping_cart_money").text("￥"+numberRand2(total_shopping_cart_money));
						}); 
						calculateShoppingCartNum();
						cacaluteShoppingCartMoney();
					}
				},
				error : function() {
					layer.msg('修改购物车失败',{time:1000});
				}
			});
			
		}
		
		// 全选
		$("input[name^='btn_select_all']").each(function(){
			$(this).click(function(event){
				if($(this).is(":checked")){
					$("input[name^='btn_select_all']").prop("checked", true);
					$(":checkbox[name='cart_chk']").prop("checked",true);
				}else{
					$("input[name^='btn_select_all']").prop("checked", false);
					$(":checkbox[name='cart_chk']").prop("checked",false);
				}
				calculateShoppingCartNum();
				cacaluteShoppingCartMoney();
			});
		});
		
		$(":checkbox[name='cart_chk']").each(function(){
			$(this).click(function(){
				calculateShoppingCartNum();
				cacaluteShoppingCartMoney();
			});
		});
		
		
		// 删除选中的购物车商品
		var idsStr = '';
		$("#btn_batch_del_cart_item").click(function(){
			var selectedNum = $(":checkbox[name='cart_chk']:checked").length;
			if(selectedNum == 0){
				layer.msg('请选择要删除的商品',{time:1000});
				return false;
			}
			var ids = [];
			$(":checkbox[name='cart_chk']:checked").each(function(){
				ids.push($(this).attr("id"));
			});
			idsStr = '';
			idsStr = ids.join(",");
			$("#del_type").val("2");
			$("#del_confirm_msg").text("是否删除选中的商品？");
			$('#del_box').toggle();
			calculateShoppingCartNum();
		});
		
		// 删除单条购物车商品
		$("a[id^='btn_del_cart_item']").each(function(){
			$(this).click(function(){
				$('#del_box').toggle();
				idsStr = '';
				var id = $(this).closest("tr").find(":checkbox").attr("id");
				var productId = $(this).attr("productId");
				var ids = [];
				ids.push(id);
				idsStr = ids.join(",");
				$("#del_type").val("1");
				$("#del_confirm_msg").text("是否删除商品？");
				$("#btn_confirm_add_to_favorite").attr("productId", productId)
				calculateShoppingCartNum();
			});
		});
		
		// 确认删除单条购物车商品
		$("#btn_confirm_delete").click(function(){
			var url = rootPath + "/pc/shoppingcart/deleteCartItem";
			var form = $('<form></form>');  
		    form.attr('action', url);  
		    form.attr('method', 'post');
		    form.attr('target', '_self');
		    form.appendTo("body");
		    form.append($("<input type='hidden' name='ids' value='"+idsStr+"'/>"));
		    form.submit();
		    calculateShoppingCartNum();
		});
		
		//删除时添加收藏
		$("#btn_confirm_add_to_favorite").click(function(){
			var id = $(this).attr("productId");
			doAddFavorite(id);
		});
		// 批量收藏购物车商品
		$("#btn_batch_add_to_favorite").click(function(){
			var selectedNum = $(":checkbox[name='cart_chk']:checked").length;
			if(selectedNum == 0){
				layer.msg('请选择要收藏的商品',{time:1000});
				return false;
			}
			var ids = [];
			$(":checkbox[name='cart_chk']:checked").each(function(){
				ids.push($(this).attr("productId"));
			});
			idsStr = '';
			idsStr = ids.join(",");
			doAddFavorite(idsStr);
		});
		// 收藏单条购物车商品
		$("a[id^='btn_add_to_favorite']").each(function(){
			$(this).click(function(){
				var id = $(this).attr("productId");
				doAddFavorite(id);
			});
		});
		
		
		$("#btn_close").click(function(){
			$('#del_box').toggle();
		});
		
		
		// 购物车结算
		$("#btn_shoppingcart_settle").click(function(){
			// 判断用户是否登录
			var url = rootPath + "/home/checkLogin";
			$.ajax({
				type : "post",
				url : url,
				data : {},
				datatype : "json",
				success : function(json) {
					if (json.resultCode == '1') {
						// 用户已经登录
						// 结算选中的商品
						var selectedNum = $(":checkbox[name='cart_chk']:checked").length;
						if(selectedNum == 0){
							layer.msg('请选择要结算的商品',{time:1000});
							return false;
						}
						var ids = [];
						$(":checkbox[name='cart_chk']:checked").each(function(){
							ids.push($(this).attr("id"));
						});
						idsStr = '';
						idsStr = ids.join(",");
						
						var url = rootPath + "/pc/shoppingcart/settlement";
						var form = $('<form></form>');  
					    form.attr('action', url);  
					    form.attr('method', 'post');
					    form.attr('target', '_self');
					    form.append("<input type='hidden' name='shoppingIds' value='"+idsStr+"'/>");
					    form.appendTo("body");
					    form.submit();
						
					}else{
						// 弹出登录窗口
						$('#myloginbox').toggle();
					}
				},
				error : function() {
					layer.msg('判断登录失败',{time:1000});
				}
			});
		});
		
		calculateShoppingCartNum();
		
 	});
 	
 	// 计算购物车数量
 	function calculateShoppingCartNum(){
 		//全部购物车数量
 		var total_shopping_cart_num = 0; 
 		//已选择的购物车数量
 		var selected_shopping_cart_num = 0;
		$("tr[name='shopping_cart_item']").each(function(){ 
			var buyNum = parseFloat($(this).find("#item_buy_num").val()); 
			total_shopping_cart_num += buyNum;
			if ($(this).find(":checkbox[name='cart_chk']:checked").length > 0) {
				selected_shopping_cart_num += buyNum;
			}
		}); 
		$('#selected_num').text(selected_shopping_cart_num);
		// $('#total_shopping_cart_num').text(total_shopping_cart_num);
 	}
 	
 	// 计算购物车价格
 	function cacaluteShoppingCartMoney(){
 		var shopping_cart_money = 0;
		$(":checkbox[name='cart_chk']:checked").each(function(){
			shopping_cart_money = shopping_cart_money + parseFloat($(this).parent().find("#item_product_pric").val())*parseFloat($(this).parent().parent().find("#item_buy_num").val());
		});
		$("#shopping_cart_money").text("￥"+numberRand2(shopping_cart_money));
 	}
 	
 	/**
 	 * 加入收藏
 	 */
 	function doAddFavorite(idsStr) {
 		var successCount = 0;
 		var failedCount = 0;
 		$.ajax({
 			type: 'POST',
 			url: rootPath + "/home/isLogin",
 			async: false,
 			dataType: 'json',
 			success: function(json) {
 				if(json.code == '1') {
 					var idArr = idsStr.split(",");
 					for(var i = 0; i < idArr.length; i ++) {
 						if(idArr[i]) {
 							$.ajax({
 		 						type : "post",
 		 						url : rootPath + '/wx/favorite/addFavorite',
 		 						data : {
 		 						    productId : idArr[i]
 		 						},
 		 						async: false,
 		 						datatype : "json",
 		 						success : function(data) {
 		 							if (data.code == '1') {
 		 								successCount ++;
 		 							} else {
 		 								failedCount ++;
 		 							}
 		 						},
 		 						error : function() {
 		 							failedCount ++;
 		 						}
 		 					});
 						}
 					}
					layer.msg('有' + successCount + '条商品加入收藏！',{time:1000});
 				} else {
 					// layer.msg('请先登录！',{time:1000});
 					window.location.href='<%=basePath %>/home/loginPage';
 				}
 			}
 		});
 		$('#del_box').hide();
 	}
 	
  	// $('a.delbtn,#del_box .hd span a,.del_info p input').click(function(){$('#del_box').toggle();});
	
  	$("#btn_clear_user_name").click(function(){
  		$("#userCode").val("");
  	});
  	
  	
  	// 登录
  	$("#btn_login").click(function() {
        $("#errorDiv").html('');
        //校验
        var userCode = $("#userCode").val();
        var password = $("#password").val();
        if($.trim(userCode).length < 6) {
            $("#errorDiv").html('<span class="glyphicon glyphicon-minus-sign"></span>&nbsp;请输入正确的用户名！');
            $("#userCode").focus();
            $("#userCode").select();
            return;
        }
        if($.trim(password).length < 6) {
            $("#errorDiv").html('<span class="glyphicon glyphicon-minus-sign"></span>&nbsp;请输入正确的密码！');
            $("#password").focus();
            $("#password").select();
            return;
        }
        $.ajax({
            url : rootPath + "/home/login",
            type : "post",
            async : false,
            dataType : 'json',
            data : {
                userCode : userCode,
                password : password
            },
            success : function(json) {
                if (json.code == '1') {
                    window.location.href = rootPath + '/pc/shoppingcart/list'
                } else {
                    $("#errorDiv").html('<span class="glyphicon glyphicon-minus-sign"></span>&nbsp;' + json.msg);
                    $("#password").focus();
                    $("#password").select();
                }
            }
        });
    });
  	
  	

	//tab function
	function TabSelect(tab,con,addClass,obj) {
	    var jQuery_self = obj;
	    var jQuery_nav = jQuery(tab);
	
	    jQuery_nav.removeClass(addClass),
		jQuery_self.addClass(addClass);
	
	    var jQuery_index = jQuery_nav.index(jQuery_self);
	    var jQuery_con = jQuery(con);
	    jQuery_con.hide();
		jQuery_con.eq(jQuery_index).show();
	}

</script>
</body>
</html>